package com.woniu.springboot.mapper;

import org.apache.ibatis.annotations.*;
import com.woniu.springboot.entity.Employee;

import java.util.Collection;
import java.util.List;

@Mapper
public interface EmployeeMapper {
    Collection<Employee> getAll();
    Employee get(Integer id);
    @Delete("delete from t_emp where id = #{id}")
    int delete(Integer id);
    @Insert("insert into t_emp(lastName,email,gender,dept_id) values(#{e.lastName}," +
            "#{e.email},#{e.gender},#{e.department.did})")
    int insert(@Param("e") Employee employee);
    List<Employee> selectEmployeeByName(String name);
    int update(@Param("e") Employee employee);
}
